#include "chap05.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
	island *start = NULL;
	island *i = NULL;
	island *next = NULL;
	char *p;
	char name[80];
	for(; fgets(name, 80, stdin) != NULL; i = next){
		p = strchr(name, '\n');
		if(p) *p = 0;
		next = create(name);
		if (start == NULL){
			start = next;
		}
		if (i != NULL){
			i->next = next;
		}
	}
	display(start);
	release(start);
	return 0;
}

